package com.sws.yygh.hosp.controller;

import com.sws.yygh.common.result.Result;
import com.sws.yygh.hosp.service.DepartmentService;
import com.sws.yygh.model.hosp.Department;
import com.sws.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @program: Appointment-hospital-registration-system
 * @description: 科室视图控制层
 * @author:
 * @create: 2022-07-24 00:05
 */
@Api(tags = "科室排班信息")
@RestController
@RequestMapping("/admin/hosp/department")
//@CrossOrigin
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @ApiOperation(value = "查询医院所有科室列表根据医院编号")
    @GetMapping("getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode){
       List<DepartmentVo> departmentList = departmentService.findDeptTree(hoscode);
       return Result.ok(departmentList);
    }
}
